package haind;

import java.util.ArrayList;
import java.util.List;
import Adapters.PagerGradeAdapter;
import Views.GradeFragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import main.pak.R;

public class GradesActivity extends FragmentActivity {
	PagerGradeAdapter pageAdapter;
    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_grades);
      List<Fragment> fragments = getFragments();
      pageAdapter = new PagerGradeAdapter(getSupportFragmentManager(), fragments);
      ViewPager pager = (ViewPager)findViewById(R.id.mainpager);
      pager.setAdapter(pageAdapter);
    }
private List<Fragment> getFragments(){
  List<Fragment> fList = new ArrayList<Fragment>();
 
  fList.add(GradeFragment.newInstance("Pre-Kindergarten"));
  fList.add(GradeFragment.newInstance("Kindergarten")); 
  fList.add(GradeFragment.newInstance("Class 1"));
 
  return fList;
}
}